include ./define.makefile
.PHONY:all

all:${COMMON_LOGIC_DESC_H} ${COMMON_LOGIC_DESC_CPP} ${COMMON_LOGIC_DESC_STRUCT_H} ${COMMON_LOGIC_DESC_STRUCT_CPP} ${PROTOCOL_CS_LOGIC_H} ${PROTOCOL_CS_LOGIC_CPP} ${PROTOCOL_CS_STRUCT_H} ${PROTOCOL_CS_STRUCT_CPP} ${PROTOCOL_SS_LOGIC_H} ${PROTOCOL_SS_LOGIC_CPP} ${PROTOCOL_SS_STRUCT_H} ${PROTOCOL_SS_STRUCT_CPP}

${COMMON_LOGIC_DESC_H} ${COMMON_LOGIC_DESC_CPP} ${COMMON_LOGIC_DESC_STRUCT_H} ${COMMON_LOGIC_DESC_STRUCT_CPP}:${COMMON_LOGIC_DESC_XML}
	mkdir -p ${PROTOCGEN_FILE_PATH}
	mkdir -p ${NEW_PROTOCGEN_FILE_PATH}
	${PROTOC} $^ --plugin=protoc-gen-nanopb=${NANOPB_PLUGIN} -I${THIRD_PARTY_INC_PATH} -I${NANOPB_PLUGIN_PROTO} -I${PROTOCOL_PATH} -I${COMMON_LOGIC_META_PATH} --cpp_out=${PROTOCGEN_FILE_PATH} --nanopb_out=-e.nanopb:${PROTOCGEN_FILE_PATH}
	${FILE_COPY_EXE} --work="filecopy" --src="${COMMON_LOGIC_DESC_H} ${COMMON_LOGIC_DESC_CPP} ${COMMON_LOGIC_DESC_STRUCT_H} ${COMMON_LOGIC_DESC_STRUCT_CPP}" --dst=${NEW_PROTOCGEN_FILE_PATH}/

${PROTOCOL_CS_LOGIC_H} ${PROTOCOL_CS_LOGIC_CPP} ${PROTOCOL_CS_STRUCT_H} ${PROTOCOL_CS_STRUCT_CPP}:${PROTOCOL_CS_LOGIC_XML}
	mkdir -p ${PROTOCGEN_FILE_PATH}
	mkdir -p ${NEW_PROTOCGEN_FILE_PATH}
	${PROTOC} $^ --plugin=protoc-gen-nanopb=${NANOPB_PLUGIN}  -I${THIRD_PARTY_INC_PATH} -I${NANOPB_PLUGIN_PROTO} -I${PROTOCOL_PATH} -I${PROTOCOL_SS_PATH} -I${PROTOCOL_SS_LOGIC_PATH} -I${PROTOCOL_CS_LOGIC_PATH} -I${COMMON_LOGIC_META_PATH} --cpp_out=${PROTOCGEN_FILE_PATH} --nanopb_out=-e.nanopb:${PROTOCGEN_FILE_PATH}
	${FILE_COPY_EXE} --work="filecopy" --src="${PROTOCOL_CS_LOGIC_H} ${PROTOCOL_CS_LOGIC_CPP} ${PROTOCOL_CS_STRUCT_H} ${PROTOCOL_CS_STRUCT_CPP}" --dst=${NEW_PROTOCGEN_FILE_PATH}/

${PROTOCOL_SS_LOGIC_H} ${PROTOCOL_SS_LOGIC_CPP} ${PROTOCOL_SS_STRUCT_H} ${PROTOCOL_SS_STRUCT_CPP}:${PROTOCOL_SS_LOGIC_XML}
	mkdir -p ${PROTOCGEN_FILE_PATH}
	mkdir -p ${NEW_PROTOCGEN_FILE_PATH}
	${PROTOC} $^ --plugin=protoc-gen-nanopb=${NANOPB_PLUGIN}  -I${THIRD_PARTY_INC_PATH} -I${NANOPB_PLUGIN_PROTO} -I${PROTOCOL_PATH} -I${PROTOCOL_SS_PATH} -I${PROTOCOL_SS_LOGIC_PATH}  -I${PROTOCOL_CS_LOGIC_PATH} -I${COMMON_LOGIC_META_PATH} --cpp_out=${PROTOCGEN_FILE_PATH} --nanopb_out=-e.nanopb:${PROTOCGEN_FILE_PATH}
	${FILE_COPY_EXE} --work="filecopy" --src="${PROTOCOL_SS_LOGIC_H} ${PROTOCOL_SS_LOGIC_CPP} ${PROTOCOL_SS_STRUCT_H} ${PROTOCOL_SS_STRUCT_CPP}" --dst=${NEW_PROTOCGEN_FILE_PATH}/

